var token = localStorage.getItem("key")

function upSug() {
	if(null == document.getElementById("suggestion").value || '' == document.getElementById("suggestion").value) {
		mui.toast("请输入您的反馈或建议");
		return;
	}
	var loginData = JSON.parse(localStorage.getItem("LoginData"))
	var userId = loginData.id
	showDialog()
	$.ajax({
        type: "POST",
        url: url_prefix + "user/upload_suggestion",
        data: {
        	request: JSON.stringify({
				mobile: $("#mobile").val(),
				weChat: $("#wechat").val(),
				uName: $("#name").val(),
				QQNum: $("#QQ").val(),
				suggestion: $("#suggestion").val(),
				userId: userId,
				token: token
			})   
        },
        dataType: "json",
        success: function(data){
        	//plus.nativeUI.toast(data.message, {verticalAlign: 'center'});
        	if (data.code == '300'){
				mui.toast("帐号在其他设备上登录")
				window.location.href="fastLogin.html"
			} else {
        		mui.toast(data.message); 
			}
        	dismissDialog()
        }
    });
}